package com.ciwong.epaper.widget;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;

import com.ciwong.epaper.R;
import com.ciwong.epaper.application.EpaperConstant;
import com.ciwong.epaper.modules.epaper.util.EpaperJumpManager;
import com.ciwong.epaper.modules.me.util.MeJumpManager;
import com.ciwong.epaper.util.DoubleClickCheckUtils;
import com.ciwong.epaper.util.RequestCode;
import com.facebook.drawee.view.SimpleDraweeView;


/**
 * Created by keepon on 2018/8/7.
 */
public class FindItemView extends RelativeLayout {


    private SimpleDraweeView mSearchContainer;
    private Context mContext;

    public FindItemView(Context context) {
        this(context, null);
    }

    public FindItemView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public FindItemView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        mContext = context;
        LayoutInflater.from(this.getContext()).inflate(R.layout.item_view_find_head_viem, this);
        init();
        initEvent();

    }


    private void init() {
        mSearchContainer = findViewById(R.id.iv_icon);
        mSearchContainer.setAspectRatio(3.22f);
        mSearchContainer.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (DoubleClickCheckUtils.vertify500Duration()) {
                    MeJumpManager.jumpToCommonH5Activity((Activity) mContext, R.string.go_back, "", EpaperConstant.URL_H5_BANNER);
                }
            }
        });
    }

    private void initEvent() {

    }

}
